﻿#include "consultant.h"
#include "../../include/itframework.h"
#include "../../include/itlogger.h"
#include "../../include/itcommon.h"

extern "C" __declspec(dllexport) ITModelBase* GetInstance(ITFramework *pFrame)
{
    Consultant *pConsultant = Consultant::GetInstance();
    pConsultant->SetFramework(pFrame);
    return dynamic_cast<ITModelBase*>(pConsultant);
}

Consultant::Consultant()
{
    qDebug() << "Consultant::Consultant()";
}

Consultant::~Consultant()
{
    qDebug() << "Consultant::~Consultant()";
}

void Consultant::SetFramework(ITFramework *pFrm)
{
    m_pFramework = pFrm;
    m_pFramework->GetLogger(&m_pLogger);
    m_pFramework->GetCommon(&m_pcommon);
}

T_BEGIN_MAP(Consultant)
    T_HANDLER(UI_CONSULTANT_reply_CMD_ID,OnReply,TUICONSULTANT_reply_Param,TObject)
T_END_MAP

void Consultant::OnReply(TUICONSULTANT_reply_Param *pInArgs, TObject *pOutArgs)
{
    qDebug() << "Consultant::OnSendReply=" << pInArgs->sendReply << "thread id=" << QThread::currentThreadId();
}
